<div class="container-fluid">
    <form class="form-horizontal">
        <div class="control-group">
            <label class="control-label">供应商ID:</label>
            <div class="controls">
                <input type="text" name="supplier_id" id="supplier_id">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">SKU:</label>
            <div class="controls">
                <input type="text" name="sku" value=" ">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">供应商名称:</label>
            <div class="controls">
                <input type="text" name="supplier_name" id="supplier_name">
                <input type="submit"  class="btn btn-info" name="supplierbanksearch" value="查询">
            <button class="btn btn-info" type="reset">重置</button>
                </div>
            </div>
</form>
<table class="table table-hover">
    <thead>
        <tr>
            <th><input type="checkbox" id="chooseall"/></th>
            <th>供应商ID</th>
            <th>供应商名称</th>
            <th>SKU</th>
            <th>单价</th>
            <th>是否出口退税</th>
            <th>退税率</th>
            <th>结算方式</th>
            <th>地址</th>
            <th>联系人</th>
            <th>电话</th>
            <th>添加时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <?php
    if(isset($re_lists))
    {
    foreach($re_lists as $num=>$data){
    ?>
    <tr>
        <tr id="select_<?php echo $re['id']; ?>">
            <td>
                <input type="checkbox" name="choose"/>
            </td>
        <td>
            <?php
            echo isset($data['supplier_id'])?$data['supplier_id']:0;
            ?>
        </td>
        <td>
            <?php
            echo isset($data['supplier_name'])?$data['supplier_name']:'';
            ?>
        </td>
            <td>SKU</td>
            <td>单价</td>
            <td>是否出口退税</td>
        <td>
            <?php
            echo isset($data['paywayname'])?$data['paywayname']:'';
            ?>
        </td>
        <td>
            <?php
            echo isset($data['bankname'])?$data['bankname']:'';
            ?>
        </td>
        <td>
            <?php
            echo isset($data['bankaccount'])?$data['bankaccount']:'';
            ?>
        </td>
        <td>
            <?php
            echo isset($data['bankaccountname'])?$data['bankaccountname']:'';
            ?>
        </td>
        <td>
            <?php
            echo isset($data['coins_name'])?$data['coins_name']:'';
            ?>
        </td>
        <td>
            <?php
            echo isset($data['check_status_string'])?$data['check_status_string']:'';
            ?>
        </td>
        <td>
            <div class="dropdown">
                <button type="button" class="btn dropdown-toggle" id="dropdownMenu1"
                        data-toggle="dropdown">
                    操作
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                    <li role="presentation">
                        <a href="<?php echo url::base(true).'supplier/suppliercheck/checkstatus?id='.(isset($data['id'])?$data['id']:0)?>">修改</a>
                    </li>
                    <li role="presentation">
                        <a href="<?php echo url::base(true).'supplier/suppliercheck/delete_bank?id='.(isset($data['id'])?$data['id']:0)?>">删除</a>
                    </li>
                </ul>
            </div>
        </td>
    </tr>
    <?php }?>
    <?php }?>
</table>
</div>
<div>
    <?php echo isset($pagination)?$pagination:NULL?>
</div>

<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/css/style.css" type="text/css" media="all" />
<script src="<?php echo URL::base() ?>media/js/jquery-1.10.1.min.js"></script>
<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/artdialog/skins/default.css" type="text/css" media="all" />
<script src="<?php echo URL::base() ?>media/vendor/artdialog/jquery.artDialog.js"></script>
<link href="<?php echo URL::base() ?>media/vendor/css/ui-lightness/jquery-ui-1.10.4.custom.css" rel="stylesheet">
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-1.10.2.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-ui-1.10.4.custom.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery.ui.datepicker-zh-TW.js"></script>

<script type="text/javascript">
    $(document).ready(function(){
        $("#supplier_id").val('<?php echo isset($condtion['supplier_id'])?$condtion['supplier_id']:''?>');
        $("#supplier_name").val('<?php echo isset($condtion['supplier_name'])?$condtion['supplier_name']:''?>');
        $("#payways_id").val('<?php echo isset($condtion['payways_id'])?$condtion['payways_id']:0?>');
        $("#check_status").val('<?php echo isset($condtion['check_status'])?$condtion['check_status']:0?>');
        $("#coinid").val('<?php echo isset($condtion['coinid'])?$condtion['coinid']:0?>');
        /**
         * 修改付款方式
         */
        $(".change_active_status_btn_").click(
            function(){
                var pre = 'change_active_status_btn_';
                var num = $(this).attr('id').substr(pre.length);
                var id = $("#id_"+num).text();
                var payaccountinfo_id = $("#payaccountinfo_id_"+num).text();
                var active_status = $("#active_status_"+num).text();
                var active_status_next = 9;
                if(active_status == 9)
                {
                    active_status_next = 1;
                }
                var data = {'id':id,'payaccountinfo_id':payaccountinfo_id,'active_status':active_status_next};
                var re;
                $.ajax(
                    {
                        type:'post',
                        url:'<?php echo url::base(true)?>supplier/supplierbank/changestatus',
                        dataType:'json',
                        data:data,
                        async:false,
                        success:function(re_data)
                        {
                            re = re_data;
                        },
                        error:function()
                        {
                            var error = new Object;
                            error.code = '8';
                            error.msg = "系统出错，请联系IT";
                            re = error;
                        }
                    }
                );

                alert(re.msg);
                if(re.code == 1)
                {
                    location.reload();
                }
            }
        );


    })
</script>